#ifndef BOXWIDGET_H
#define BOXWIDGET_H

#include <QtGui>
#include <QFtp>
#include "ui_boxoper.h"
#include "filesystemmodel.h"
#include "rcs.h"
#include "profile.h"
#include "QHash"
#include <QSet>

class BoxWidget : public QWidget,public Ui::Form
{
    Q_OBJECT
public:
    explicit BoxWidget(QWidget *parent = 0);

private:
    FileSystemModel  *remoteModel,*localModel;
    Rcs *rcs;
    Profile *profile;
    QHash<QString, bool> isDirectory;
    QString currentPath,localCurrentPath,remotePath;
    QMenu *remoteMenu,*localMenu;
    bool uploadFlag;
    QString cdStr;
    QSet<QString> dirSet;
    QSet<QString> currentDirectory;


public:
    bool closeFtp();
    void initUi();

signals:
    void updateStatus(const QString &msg);
    void openLogDlg();
    void closeLogDlg();
    void operlog(const QString &msg);
    
public slots:
    void openOne();
    void openMms();
    void upload();

    void addToList(const QUrlInfo &info);
    void processItem(QTreeWidgetItem*,int);
    void cdToParent();
    void showRemoteMenu(const QPoint &pos);
    void showLocalMenu(const QPoint &pos);
    void clearRemote();
    void refreshRemote();
    void refreshLocal();
    void delRemote();
    void loadBoxInfo();


    //ftp
    void setEth();
    void setTelnet();
    bool reConnFtp();
    void autoRun();
    void setAutoRun();
    void cancelAutoRun();



    
};

#endif // BOXWIDGET_H
